Optimal. Leaf size=52 \[ \frac {1}{2} (a A+2 b B) x+\frac {(A b+a B) \sin (c+d x)}{d}+\frac {a A \cos (c+d x) \sin (c+d x)}{2 d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.06, antiderivative size = 52, normalized size of antiderivative = 1.00, number of steps
used = 4, number of rules used = 4, integrand size = 29, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.138, Rules used = {4081, 3872,
2717, 8} \begin {gather*} \frac {(a B+A b) \sin (c+d x)}{d}+\frac {1}{2} x (a A+2 b B)+\frac {a A \sin (c+d x) \cos (c+d x)}{2 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 2717
Rule 3872
Rule 4081
Rubi steps
\begin {align*} \int \cos ^2(c+d x) (a+b \sec (c+d x)) (A+B \sec (c+d x)) \, dx &=\frac {a A \cos (c+d x) \sin (c+d x)}{2 d}-\frac {1}{2} \int \cos (c+d x) (-2 (A b+a B)-(a A+2 b B) \sec (c+d x)) \, dx\\ &=\frac {a A \cos (c+d x) \sin (c+d x)}{2 d}-(-A b-a B) \int \cos (c+d x) \, dx-\frac {1}{2} (-a A-2 b B) \int 1 \, dx\\ &=\frac {1}{2} (a A+2 b B) x+\frac {(A b+a B) \sin (c+d x)}{d}+\frac {a A \cos (c+d x) \sin (c+d x)}{2 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.10, size = 51, normalized size = 0.98 \begin {gather*} \frac {2 a A c+2 a A d x+4 b B d x+4 (A b+a B) \sin (c+d x)+a A \sin (2 (c+d x))}{4 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.21, size = 57, normalized size = 1.10
method | result | size |
risch | \(\frac {a A x}{2}+x B b +\frac {\sin \left (d x +c \right ) A b}{d}+\frac {\sin \left (d x +c \right ) B a}{d}+\frac {A a \sin \left (2 d x +2 c \right )}{4 d}\) | \(51\) |
derivativedivides | \(\frac {A a \left (\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+A b \sin \left (d x +c \right )+B a \sin \left (d x +c \right )+B b \left (d x +c \right )}{d}\) | \(57\) |
default | \(\frac {A a \left (\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+A b \sin \left (d x +c \right )+B a \sin \left (d x +c \right )+B b \left (d x +c \right )}{d}\) | \(57\) |
norman | \(\frac {\left (-\frac {A a}{2}-B b \right ) x +\left (-\frac {A a}{2}-B b \right ) x \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (\frac {A a}{2}+B b \right ) x \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (\frac {A a}{2}+B b \right ) x \left (\tan ^{6}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-\frac {\left (A a -2 A b -2 B a \right ) \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}-\frac {\left (A a +2 A b +2 B a \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{d}+\frac {2 A a \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}}{\left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{2} \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}\) | \(180\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.29, size = 55, normalized size = 1.06 \begin {gather*} \frac {{\left (2 \, d x + 2 \, c + \sin \left (2 \, d x + 2 \, c\right )\right )} A a + 4 \, {\left (d x + c\right )} B b + 4 \, B a \sin \left (d x + c\right ) + 4 \, A b \sin \left (d x + c\right )}{4 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 4.80, size = 42, normalized size = 0.81 \begin {gather*} \frac {{\left (A a + 2 \, B b\right )} d x + {\left (A a \cos \left (d x + c\right ) + 2 \, B a + 2 \, A b\right )} \sin \left (d x + c\right )}{2 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \left (A + B \sec {\left (c + d x \right )}\right ) \left (a + b \sec {\left (c + d x \right )}\right ) \cos ^{2}{\left (c + d x \right )}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 121 vs.
\(2 (48) = 96\).
time = 0.48, size = 121, normalized size = 2.33 \begin {gather*} \frac {{\left (A a + 2 \, B b\right )} {\left (d x + c\right )} - \frac {2 \, {\left (A a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 2 \, B a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 2 \, A b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - A a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 2 \, B a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 2 \, A b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 1\right )}^{2}}}{2 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 2.03, size = 50, normalized size = 0.96 \begin {gather*} \frac {A\,a\,x}{2}+B\,b\,x+\frac {A\,b\,\sin \left (c+d\,x\right )}{d}+\frac {B\,a\,\sin \left (c+d\,x\right )}{d}+\frac {A\,a\,\sin \left (2\,c+2\,d\,x\right )}{4\,d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________